package com.itheima.util;

import com.itheima.pojo.Brand;

import java.util.*;


public class Page {
    private int pageSun;
    private int pageNo;
    private int pageCount;
    private int pagesize = 5;

    private List<Brand> brands;

    public Page() {
    }

    public Page(int pageSun, int pageNo, int pageCount, int pagesize, List<Brand> brands) {
        this.pageSun = pageSun;
        this.pageNo = pageNo;
        this.pageCount = pageCount;
        this.pagesize = pagesize;
        this.brands = brands;
    }

    public int getPageSun() {
        return pageSun;
    }

    public void setPageSun(int pageSun) {
        this.pageSun = pageSun;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageSun = pageCount % pagesize == 0 ? pageCount / pagesize : pageCount / pagesize + 1;
        this.pageCount = pageCount;
    }

    public int getPagesize() {
        return pagesize;
    }

    public void setPagesize(int pagesize) {
        this.pagesize = pagesize;
    }

    public List<Brand> getBrands() {
        return brands;
    }

    public void setBrands(List<Brand> brands) {
        this.brands = brands;
    }
}
